$source = $args[0]

function Remove-Scc
{
	param($f)
	
	$stopwriting = "0"
	(get-content -encoding UTF8 $f) | foreach-object -process { 	$realLine = $_.ToString(); 	if ($realLine.Trim() -like "EndGlobalSection") 		{ $stopwriting = "0"	} 	if ($realLine.Trim() -notlike "GlobalSection(TeamFoundationVersionControl)*" ) 	{			if ($stopwriting -eq "0") 			{ $realLine } } 		else 			{ $stopWriting = "1" }	} 	| set-content -encoding UTF8 $f
	
	$c = get-content -encoding UTF8 $f
	$c = $c -replace("SAK", "")
	set-content -encoding UTF8 $f -value $c
}


dir -path $source -Include *.vspscc, *.vssscc, *.scc -Recurse | Remove-Item
dir -path $source -include *.sln, *.csproj, *.vbproj -Recurse | foreach { Remove-Scc $_.Fullname.ToString()}

$folders = dir -path $source -Recurse | where {$_.PSIsContainer}
foreach($folder in $folders)
{
	if (!(dir $folder.FullName))
	{
		remove-item $folder.FullName
	}
}





